import Mock from 'mockjs';

const getIndexBanner = (req: Request, res: { send: (arg0: any) => any }) => {
  return res.send(
    Mock.mock({
      code: 200,
      'data|5': [
        {
          id: '@id',
          image: `http://lorempixel.com/750/400/food?v=@id`,
          link: '#',
        },
      ],
    }),
  );
};

const getIndexRecommend = (req: Request, res: { send: (arg0: any) => any }) => {
  return res.send(
    Mock.mock({
      code: 200,
      data: {
        'list|20': [
          {
            id: '@id',
            image: `http://lorempixel.com/375/450/food?v=@id`,
            author: '@cname',
            avatar: `http://lorempixel.com/100/100/cats?v=@id`,
            content: '@csentence(5,30)',
            createTime: '@datetime("2020-08-dd HH:mm:ss")',
          },
        ],
      },
    }),
  );
};

export default {
  getIndexBanner,
  getIndexRecommend,
};
